package com.sc.nft.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sc.nft.enums.SecondWantBuyOrderStatusEnum;
import com.sc.nft.enums.SecondWantBuyOrderTypeEnum;
import com.sc.nft.sup.SuperEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author 刘国航
 * @desc
 * @since 2024/12/19 19:27
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("sc_want_buy_order")
public class WantBuyOrder extends SuperEntity implements Serializable {

    private static final long serialVersionUID = 912960783480709741L;

    /**
     * 账号id
     */
    private Long userId;

    /**
     * 求购单类型
     */
    private SecondWantBuyOrderTypeEnum orderType;

    /**
     * 关联id
     */
    private Long relationId;

    /**
     * 求购单价
     */
    private BigDecimal wantBuyPrice;

    /**
     * 求购数量
     */
    private Integer wantBuyQuantity;

    /**
     * 剩余求购数量
     */
    private Integer usableWantBuyQuantity;

    /**
     * 求购持有条件
     */
    private Boolean enableWantBuyHoldCondition;

    /**
     * 求购消耗道具
     */
    private Boolean enableWantBuyConsumeProp;

    /**
     * 求购持有藏品id
     */
    private Long wantBuyHoldCollectionId;

    /**
     * 求购消耗道具id
     */
    private Long wantBuyConsumePropId;

    /**
     * 求购消耗道具数量
     */
    private Integer wantBuyConsumePropQuantity;

    /**
     * 手续费比例
     */
    private BigDecimal charge;

    /**
     * 最低手续费
     */
    private BigDecimal minCharge;

    /**
     * 上链费
     */
    private BigDecimal gas;

    /**
     * 状态
     */
    private SecondWantBuyOrderStatusEnum status;

    /**
     * 开始时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    /**
     * 结束时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /**
     * 支付金额
     */
    private BigDecimal payAmount;

    /**
     * 余额金额
     */
    private BigDecimal balanceAmount;

    /**
     * 可用余额金额
     */
    private BigDecimal usableBalanceAmount;

    /**
     * 原石金额
     */
    private BigDecimal payBalanceAmount;

    /**
     * 可用原石金额
     */
    private BigDecimal usablePayBalanceAmount;

    /**
     * 退回金额
     */
    private BigDecimal refundAmount;

    /**
     * 退回道具
     */
    private Integer refundProp;

    /**
     * 版本号
     */
    @Version
    private Integer version;

}
